package com.itheima.controller;

import com.itheima.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class UserController {
    public static void main(String[] args) throws Exception{

        //创建spring核心配置文件IOC
       ApplicationContext ac = new ClassPathXmlApplicationContext("spring.xml");

       //从容器中获取Bean对象
        UserService userService = (UserService) ac.getBean("UserService");
        userService.findAll();

    }
}
